<!--
#  Copyright 2008, Javid Jamae and Peter Johnson
# 
#  Licensed under the Apache License, Version 2.0 (the "License"); you may not
#  use this file except in compliance with the License. You may obtain a copy
#  of the License at
# 
#     http://www.apache.org/licenses/LICENSE-2.0
#  
#  Unless required by applicable law or agreed to in writing, software
#  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#  License for the specific language governing permissions and limitations
#  under the License.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<head>
<link rel="STYLESHEET" href="../ch00/image/jbia.css" type="text/css" />
<title>JBIA - Managing the JBoss Application Server</title>
</head>

<body>

<h1>Ch 14 - Tuning the JBoss Application Server</h1>
<p>Most build targets create an application server configuration named <code>
perf</code>.</p>
<p>None of the targets create a database.</p>
<hr />
<table class="target">
  <tr>
    <th>Target:</th>
    <td class="targetNumber">01</td>
  </tr>
  <tr>
    <th>Section:</th>
    <td>14.5.1 & 14.5.2</td>
  </tr>
  <tr>
    <th>Description:</th>
    <td>Creates an application server configuration that has the suggested
    heap settings, and has -verbose:gc set.</td>
  </tr>
  <tr>
    <th colspan="2">After the build:</th>
  </tr>
</table>
<p>The build creates a special run script specifically for this application
server. This run script sets the suggested heap settings and the -verbose:gc
option. To run with these settings, and to redirect the console output to a
file, open another command window, <code>cd</code> to the applications server's
<code>bin</code> directory, and enter:</p>
<table class="command">
  <tr>
    <td class="commandText">./run-perf.sh > perf.out 2>&1</td>
    <td>(Linux)</td>
  </tr>
  <tr>
    <td class="commandText">run-perf > perf.out 2>>&1</td>
    <td>(Windows)</td>
  </tr>
</table>
<p>The redirected output will come in handy for target 02.</p>
<hr />
<table class="target">
  <tr>
    <th>Target:</th>
    <td class="targetNumber">02</td>
  </tr>
  <tr>
    <th>Section:</th>
    <td>14.5.3</td>
  </tr>
  <tr>
    <th>Description:</th>
    <td>Creates an application that can be used to analyze garbage
    collection data.</td>
  </tr>
  <tr>
    <th colspan="2">After the build:</th>
  </tr>
</table>
<p>First, you need some data to analyze. Target 01 generates such data;
bringing the application server up and then down again should generate around a
dozen garbage collections. That is not much, but sufficient to try out this
utility. To analyze that data, at the command prompt where you did the build,
enter:</p>
<table class="command">
  <tr>
    <td class="commandText">target/dist/analyser.sh
    $JBOSS_HOME/bin/perf.out</td>
    <td>(Linux)</td>
  </tr>
  <tr>
    <td class="commandText">target\dist\analyser %JBOSS_HOME%\bin\perf.out</td>
    <td>(Windows)</td>
  </tr>
</table>
<p>The utility creates a file named <code>perf.out.csv</code> in the <code>bin</code>
directory . You can open that file with a text editor, or a spreadsheet, to view
the data. If you open it with a spreadsheet, try graphing the data as described
in table 14.5, <q>Graphing garbage collection data</q>.</p>
<p>The utility can also analyze PrintGCDetails and PrintHeapAtGC data, run
the utility without any parameters for help text that describes the options
available.</p>
<hr />
<p align="center">&copy; 2008, Javid Jamae and Peter Johnson</p>
</body>

</html>
